package comAPIdlw;
/**
 * @Author: dlw
 * @QQ : 1595507337
 * @desc:菜单实现热门视频数据抓取比特币客户端通信原始格式推到功能集成
 * @Date: 2021/12/4 9:11
 */
import comAPIdlw.address.BitCoinAddress;
import comAPIdlw.service.GetBestBlockHashService;
import comAPIdlw.service.GetBlockCountService;
import comAPIdlw.service.HotVideoService;
import java.security.KeyPair;
import java.util.Scanner;

/**
 *   参考聚合数据网站，实现Java请求聚合平台的数据，并实现数据分析
 *   key: d165af931f115ad3574e8f98fe11b383
 *   url: http://apis.juhe.cn/fapig/douyin/billboardv
 *   备注:用于获取旅游达人总榜、旅游新势力榜
 */
public class main {
    public static void main(String[] args) {

       // git stash  暂存区   保护现场
      //  git stash pop      恢复现场
        new main().run();
    }
               public void  run(){
                   System.out.println("java期末大作业程序");
                   System.out.println("功能:");
                   System.out.println("1热门视频数据");
                   System.out.println("2比特币客户端通行获取最高区块的hash值和获取区块总数");
                   System.out.println("3原始格式推导");
                   System.out.println("0退出");
                   while (true){
                       menu();
                   }
               }
               public  void  menu(){
                   System.out.println("输入要实现功能的编号:");
                   Scanner scanner = new Scanner(System.in);
                   int num = scanner.nextInt();
                   switch (num){
                       case 1:
                           HotVideoService hotVideoService = new HotVideoService();
                           System.out.println(hotVideoService.getHotVideo());
                            break;
                       case 2:
                           System.out.println("最高区块的hash值:"+new GetBestBlockHashService().GetBestBlockHash());
                           System.out.println("区块总数:"+new GetBlockCountService().GetBlockCount());
                       break;
                       case 3:
                           BitCoinAddress add = new BitCoinAddress();
                           KeyPair keyPair = add.generateKey();
                           String address = add.newAddress(keyPair);
                           System.out.println("新生成的比特币地址:"+address);
                           break;
                       case 0:
                           //
                           System.out.println("退出成功");
                           System.exit(0);

                       default:
                           System.out.println("不支持该功能，请重新输入编号");
                           break;
                   }
               }

    }







